const path = require('path');
const isDev = think.env === 'development';
const apiGuard = require('../common/apiGuard');
module.exports = [

    {
        handle: 'meta',
        options: {
            logRequest: isDev,
            sendResponseTime: isDev,

        }
    },
    {
        handle: 'resource',
        enable: true,
        options: {
            root: '.',
            publicPath: '/uploads/imgs/'
        }
    },
    {
        handle: 'trace',
        enable: !think.isCli,
        options: {
            debug: isDev,
            contentType: 'json'
        }
    },
    {
        handle: 'payload',
        options: {
            uploadDir: path.join(think.ROOT_PATH, 'runtime', 'temp'),
            extendTypes: {}
        }
    },
    {
        handle: 'router',
        options: {
            defaultModule: '',
            defaultController: '',
            defaultAction: '',
            suffix: [],
            enableDefaultRouter: false,
            subdomainOffset: 2,
            subdomain: {},
            denyModules: []
        }
    }, {
        handle: 'apiGuard',
        options: {
            open: true,
        }
    },
    'controller'
];
